package main

import (
	"fmt"
	gsb "github.com/parkingwang/go-sqlbuilder"
)

func insert() {
	sql := gsb.NewContext().Insert("student").
		Columns("name", "province", "city", "enrollment").
		Values("lwq", "fujian", "Zhangzhou", "2021-01-01").ToSQL()
	fmt.Println(sql)
}

func update() {
	ctx := gsb.NewContext()
	sql := ctx.Update("student").
		AddColumnValue("name", "qqq").
		AddColumnValue("province", "shanghai").
		AddColumnValue("encrllment", "shanghai").
		Where(ctx.EqTo("province", "fujian").
			And().In("city", "Zhangzhou")).ToSQL()
	fmt.Println(sql)
}

func query() {

}

func main() {
	insert()
	update()
}
